package com.idak.rdv.web.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.idak.rdv.db.Doctor;
import com.idak.rdv.service.DoctorService;

@Controller
public class DoctorsController {
	
	@Autowired
	private DoctorService doctorService;
	
	@RequestMapping(value= "doctors", method=RequestMethod.GET)
	public String Doctorslist(Model model){
		List<Doctor> doctors = doctorService.getAllDoctors();
		model.addAttribute("doctors",doctors);
	return "doctors";	
	}
}
